package com.example.hangman_in_android.view;

import com.example.hangman_in_android.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

public class SplashScreenActivity extends Activity implements Runnable {
	private static Handler handler = new Handler();

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		// Set the user interface layout for this Activity
		setContentView(R.layout.activity_splash_screen);

		if (savedInstanceState != null) {

		} else {
			handler.postDelayed(this, 3000); // Kalder run() om 3 sekunder
		}

	}

	public void run() {
		Intent intent = new Intent(this, MainActivity.class);
		startActivity(intent);
		finish();// Luk velkomsaktiviteten
	}
}
